﻿using System;
using System.Windows.Forms;
using JetBrains.Application.License;

namespace ResharperKeygen
{
    public partial class Form1 : Form
    {
        private readonly LienseGeer _lienseGeer = new LienseGeer();

        public Form1()
        {
            InitializeComponent();
        }

        private void TextBox1TextChanged(object sender, EventArgs e)
        {
            _lienseGeer._username = textBox1.Text.Trim();
            textBox2.Text = _lienseGeer.GetLicense2();

            var lienseChecker = new LicenseChecker(Constants.PUBLIC_KEY, textBox1.Text, string.Empty, textBox2.Text);

            label1.Text = "过期时间： " + lienseChecker.ExpirationDate.ToString();
        }
    }
}